package cn.wenhaha.hungry;

/**
 * @ClassName: Hungry
 * @description: TODO 饿汉单例
 * * @author: wyndem
 * @date: 2019/5/13 11:31
 * @Version: 1.0
 **/
public class Hungry {

    private static  final   Hungry hungry=new Hungry();

    private Hungry() {}

    /**
     * description: 饿汉模式在类加载时初始化对象，虽然会占用空间，但绝对是线程安全的，而且速度快
     * @Author wyndem
     * @Date 2019/5/13 12:34
     * @Param []
     * @return cn.wenhaha.hungry.Hungry
     **/
    public static  Hungry getInstance(){
        return hungry;
    }
}
